/**
 * className：PublicConifg.java <br>
 */
package com.aijk.conifg;


import java.util.Map;

/**
 * className：PublicConifg <br>
 * Function： 环境配置基础类 <br>
 * date: 2014-11-5-上午10:15:20<br>
 *
 * @author laich
 */
public class PublicConfig {

    // 防止被构造
    private PublicConfig() {

    }

    /**
     * 系统文件配置 加载。
     */
    public static final Map<String, String> PUBLIC_USER = ResourceUtils.getResource("public_user").getMap();

    /**
     * 系统文件配置 加载。
     */
    public static final Map<String, String> PUBLIC_SYSTEM = ResourceUtils.getResource("public_system").getMap();

    /**
     * zk注册中心
     */
    public static final String REGISTER_CENTER = PUBLIC_SYSTEM.get("dubbo.registry.address");

    /**
     * EH平台开发模式
     */
    public static final String EH_PLAT_MODEL_DEV = PUBLIC_SYSTEM.get("EH_PLAT_MODEL_DEV");

    /**
     * EH平台老版本接口api
     */
    public static final String EH_PLAT_API_URL_V1 = PUBLIC_SYSTEM.get("EH_PLAT_API_URL_V1");

    public static final String PUSH_URL = PUBLIC_SYSTEM.get("push.url");

    /**
     * 挂号业务参数
     */
    public static final String BOOK_NOTIFY_URL = PUBLIC_SYSTEM.get("book_notify_url");

    /**
     * rocketMq 配置参数
     */
    public static final String ROCKETMQ_NAMESRVADDR = PUBLIC_SYSTEM.get("rocketmq.NamesrvAddr");

    public static final String ROCKETMQ_NOTIFY_CONSUMERGROUP = PUBLIC_SYSTEM.get("rocketmq.notify.ConsumerGroup");


    /**
     * 创业当日挂号API接口
     */
    public static final String BSOFT_GUAHAO_TODAY_API = PUBLIC_SYSTEM.get("bsoft.guahao.today.api");

    /**
     * APP端User token 前缀
     */
    public static final String USER_TOKEN_PREFIX = PUBLIC_SYSTEM.get("user.token.prefix");

    /**
     * 定义是否正式环境
     */
    public static final String ENVIRONMENT_PRODUCTION = PUBLIC_SYSTEM.get("environment.production");

    /**
     * @return
     */
    public static boolean isProduct() {
        return "true".equalsIgnoreCase(ENVIRONMENT_PRODUCTION);
    }

    public static boolean getBoolean(String key) {
        return Boolean.parseBoolean(PUBLIC_SYSTEM.get(key));
    }


}
